package cn.com.pxto.web.tag;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;

public class DateTimePickerImporter extends BodyTagSupport {

	public int doStartTag() throws JspException {
		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		String path = request.getContextPath();
		try {
			JspWriter out = pageContext.getOut();
			out.print("<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\""+path+"/commons/calendar/calendar.css\"/>\n");
			out.print("<script type=\"text/javascript\" src=\""+path+"/commons/calendar/calendar.js\"></script>\n");
			out.print("<script type=\"text/javascript\" src=\""+path+"/commons/calendar/calendar-setup.js\"></script>\n");
			out.print("<script type=\"text/javascript\" src=\""+path+"/commons/calendar/calendar-zh.js\"></script>\n");
		} catch(IOException e){
			throw new JspException("Print Error:" + 
                    e.getMessage());
		}
		return super.doStartTag();
	}
}
